Optimal. Leaf size=122 \[ -\frac {f \cos \left (a+b (c+d x)^2\right )}{2 b d^2}+\frac {(d e-c f) \sqrt {\frac {\pi }{2}} \cos (a) S\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right )}{\sqrt {b} d^2}+\frac {(d e-c f) \sqrt {\frac {\pi }{2}} C\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right ) \sin (a)}{\sqrt {b} d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3514, 3434,
3433, 3432, 3460, 2718} \begin {gather*} \frac {\sqrt {\frac {\pi }{2}} \sin (a) (d e-c f) \text {FresnelC}\left (\sqrt {\frac {2}{\pi }} \sqrt {b} (c+d x)\right )}{\sqrt {b} d^2}+\frac {\sqrt {\frac {\pi }{2}} \cos (a) (d e-c f) S\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right )}{\sqrt {b} d^2}-\frac {f \cos \left (a+b (c+d x)^2\right )}{2 b d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 3432
Rule 3433
Rule 3434
Rule 3460
Rule 3514
Rubi steps
\begin {align*} \int (e+f x) \sin \left (a+b (c+d x)^2\right ) \, dx &=\frac {\text {Subst}\left (\int \left (d e \left (1-\frac {c f}{d e}\right ) \sin \left (a+b x^2\right )+f x \sin \left (a+b x^2\right )\right ) \, dx,x,c+d x\right )}{d^2}\\ &=\frac {f \text {Subst}\left (\int x \sin \left (a+b x^2\right ) \, dx,x,c+d x\right )}{d^2}+\frac {(d e-c f) \text {Subst}\left (\int \sin \left (a+b x^2\right ) \, dx,x,c+d x\right )}{d^2}\\ &=\frac {f \text {Subst}\left (\int \sin (a+b x) \, dx,x,(c+d x)^2\right )}{2 d^2}+\frac {((d e-c f) \cos (a)) \text {Subst}\left (\int \sin \left (b x^2\right ) \, dx,x,c+d x\right )}{d^2}+\frac {((d e-c f) \sin (a)) \text {Subst}\left (\int \cos \left (b x^2\right ) \, dx,x,c+d x\right )}{d^2}\\ &=-\frac {f \cos \left (a+b (c+d x)^2\right )}{2 b d^2}+\frac {(d e-c f) \sqrt {\frac {\pi }{2}} \cos (a) S\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right )}{\sqrt {b} d^2}+\frac {(d e-c f) \sqrt {\frac {\pi }{2}} C\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right ) \sin (a)}{\sqrt {b} d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.41, size = 114, normalized size = 0.93 \begin {gather*} \frac {-f \cos \left (a+b (c+d x)^2\right )+\sqrt {b} (d e-c f) \sqrt {2 \pi } \cos (a) S\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right )+\sqrt {b} (d e-c f) \sqrt {2 \pi } C\left (\sqrt {b} \sqrt {\frac {2}{\pi }} (c+d x)\right ) \sin (a)}{2 b d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(308\) vs.
\(2(102)=204\).
time = 0.05, size = 309, normalized size = 2.53
method | result | size |
risch | \(\frac {i e \sqrt {\pi }\, {\mathrm e}^{i a} \erf \left (-d \sqrt {-i b}\, x +\frac {i b c}{\sqrt {-i b}}\right )}{4 d \sqrt {-i b}}-\frac {i f c \sqrt {\pi }\, {\mathrm e}^{i a} \erf \left (-d \sqrt {-i b}\, x +\frac {i b c}{\sqrt {-i b}}\right )}{4 d^{2} \sqrt {-i b}}+\frac {i e \sqrt {\pi }\, {\mathrm e}^{-i a} \erf \left (d \sqrt {i b}\, x +\frac {i b c}{\sqrt {i b}}\right )}{4 d \sqrt {i b}}-\frac {i f c \sqrt {\pi }\, {\mathrm e}^{-i a} \erf \left (d \sqrt {i b}\, x +\frac {i b c}{\sqrt {i b}}\right )}{4 d^{2} \sqrt {i b}}-\frac {f \cos \left (d^{2} x^{2} b +2 c d x b +b \,c^{2}+a \right )}{2 b \,d^{2}}\) | \(209\) |
default | \(-\frac {f \cos \left (d^{2} x^{2} b +2 c d x b +b \,c^{2}+a \right )}{2 b \,d^{2}}-\frac {f c \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {b^{2} c^{2} d^{2}-b \,d^{2} \left (b \,c^{2}+a \right )}{b \,d^{2}}\right ) \mathrm {S}\left (\frac {\sqrt {2}\, \left (b \,d^{2} x +b c d \right )}{\sqrt {\pi }\, \sqrt {b \,d^{2}}}\right )-\sin \left (\frac {b^{2} c^{2} d^{2}-b \,d^{2} \left (b \,c^{2}+a \right )}{b \,d^{2}}\right ) \FresnelC \left (\frac {\sqrt {2}\, \left (b \,d^{2} x +b c d \right )}{\sqrt {\pi }\, \sqrt {b \,d^{2}}}\right )\right )}{2 d \sqrt {b \,d^{2}}}+\frac {\sqrt {2}\, \sqrt {\pi }\, e \left (\cos \left (\frac {b^{2} c^{2} d^{2}-b \,d^{2} \left (b \,c^{2}+a \right )}{b \,d^{2}}\right ) \mathrm {S}\left (\frac {\sqrt {2}\, \left (b \,d^{2} x +b c d \right )}{\sqrt {\pi }\, \sqrt {b \,d^{2}}}\right )-\sin \left (\frac {b^{2} c^{2} d^{2}-b \,d^{2} \left (b \,c^{2}+a \right )}{b \,d^{2}}\right ) \FresnelC \left (\frac {\sqrt {2}\, \left (b \,d^{2} x +b c d \right )}{\sqrt {\pi }\, \sqrt {b \,d^{2}}}\right )\right )}{2 \sqrt {b \,d^{2}}}\) | \(309\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.91, size = 484, normalized size = 3.97 \begin {gather*} -\frac {\sqrt {2} \sqrt {\pi } {\left ({\left (-\left (i + 1\right ) \, \cos \left (a\right ) + \left (i - 1\right ) \, \sin \left (a\right )\right )} \operatorname {erf}\left (\frac {i \, b d x + i \, b c}{\sqrt {i \, b}}\right ) + {\left (-\left (i - 1\right ) \, \cos \left (a\right ) + \left (i + 1\right ) \, \sin \left (a\right )\right )} \operatorname {erf}\left (\frac {i \, b d x + i \, b c}{\sqrt {-i \, b}}\right )\right )} e}{8 \, \sqrt {b} d} - \frac {{\left (2 \, {\left ({\left (e^{\left (i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}\right )} + e^{\left (-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}\right )}\right )} \cos \left (a\right ) - {\left (-i \, e^{\left (i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}\right )} + i \, e^{\left (-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}\right )}\right )} \sin \left (a\right )\right )} d x - \sqrt {b d^{2} x^{2} + 2 \, b c d x + b c^{2}} {\left ({\left (-\left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}}\right ) - 1\right )} + \left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}}\right ) - 1\right )}\right )} \cos \left (a\right ) + {\left (\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}}\right ) - 1\right )} - \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\sqrt {-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}}\right ) - 1\right )}\right )} \sin \left (a\right )\right )} c + 2 \, {\left ({\left (e^{\left (i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}\right )} + e^{\left (-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}\right )}\right )} \cos \left (a\right ) - {\left (-i \, e^{\left (i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2}\right )} + i \, e^{\left (-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2}\right )}\right )} \sin \left (a\right )\right )} c\right )} f}{8 \, {\left (b d^{3} x + b c d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 134, normalized size = 1.10 \begin {gather*} -\frac {\sqrt {2} {\left (\pi c f - \pi d e\right )} \sqrt {\frac {b d^{2}}{\pi }} \cos \left (a\right ) \operatorname {S}\left (\frac {\sqrt {2} \sqrt {\frac {b d^{2}}{\pi }} {\left (d x + c\right )}}{d}\right ) + \sqrt {2} {\left (\pi c f - \pi d e\right )} \sqrt {\frac {b d^{2}}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} \sqrt {\frac {b d^{2}}{\pi }} {\left (d x + c\right )}}{d}\right ) \sin \left (a\right ) + d f \cos \left (b d^{2} x^{2} + 2 \, b c d x + b c^{2} + a\right )}{2 \, b d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (e + f x\right ) \sin {\left (a + b c^{2} + 2 b c d x + b d^{2} x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 3.83, size = 389, normalized size = 3.19 \begin {gather*} \frac {i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {b d^{2}} {\left (-\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )} {\left (x + \frac {c}{d}\right )}\right ) e^{\left (i \, a + 1\right )}}{4 \, \sqrt {b d^{2}} {\left (-\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )}} - \frac {i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {b d^{2}} {\left (\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )} {\left (x + \frac {c}{d}\right )}\right ) e^{\left (-i \, a + 1\right )}}{4 \, \sqrt {b d^{2}} {\left (\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )}} - \frac {\frac {i \, \sqrt {2} \sqrt {\pi } c f \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {b d^{2}} {\left (-\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )} {\left (x + \frac {c}{d}\right )}\right ) e^{\left (i \, a\right )}}{\sqrt {b d^{2}} {\left (-\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )}} + \frac {f e^{\left (i \, b d^{2} x^{2} + 2 i \, b c d x + i \, b c^{2} + i \, a\right )}}{b d}}{4 \, d} - \frac {-\frac {i \, \sqrt {2} \sqrt {\pi } c f \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} \sqrt {b d^{2}} {\left (\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )} {\left (x + \frac {c}{d}\right )}\right ) e^{\left (-i \, a\right )}}{\sqrt {b d^{2}} {\left (\frac {i \, b d^{2}}{\sqrt {b^{2} d^{4}}} + 1\right )}} + \frac {f e^{\left (-i \, b d^{2} x^{2} - 2 i \, b c d x - i \, b c^{2} - i \, a\right )}}{b d}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sin \left (a+b\,{\left (c+d\,x\right )}^2\right )\,\left (e+f\,x\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________